\(\int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx\) [498]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F(-1)]
   Mupad [F(-1)]

Optimal result

Integrand size = 35, antiderivative size = 98 \[ \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx=\frac {\sqrt {a} (2 A+B) \arcsin \left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}}{d}+\frac {a B \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)} \sqrt {\sec (c+d x)}} \]

[Out]

a*B*sin(d*x+c)/d/(a+a*cos(d*x+c))^(1/2)/sec(d*x+c)^(1/2)+(2*A+B)*arcsin(sin(d*x+c)*a^(1/2)/(a+a*cos(d*x+c))^(1
/2))*a^(1/2)*cos(d*x+c)^(1/2)*sec(d*x+c)^(1/2)/d

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.114, Rules used = {3040, 3060, 2853, 222} \[ \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx=\frac {\sqrt {a} (2 A+B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \arcsin \left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a \cos (c+d x)+a}}\right )}{d}+\frac {a B \sin (c+d x)}{d \sqrt {\sec (c+d x)} \sqrt {a \cos (c+d x)+a}} \]

[In]

Int[Sqrt[a + a*Cos[c + d*x]]*(A + B*Cos[c + d*x])*Sqrt[Sec[c + d*x]],x]

[Out]

(Sqrt[a]*(2*A + B)*ArcSin[(Sqrt[a]*Sin[c + d*x])/Sqrt[a + a*Cos[c + d*x]]]*Sqrt[Cos[c + d*x]]*Sqrt[Sec[c + d*x
]])/d + (a*B*Sin[c + d*x])/(d*Sqrt[a + a*Cos[c + d*x]]*Sqrt[Sec[c + d*x]])

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 2853

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/Sqrt[(d_.)*sin[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[-2/f, Su
bst[Int[1/Sqrt[1 - x^2/a], x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, d, e, f}, x]
&& EqQ[a^2 - b^2, 0] && EqQ[d, a/b]

Rule 3040

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.
) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(g*Csc[e + f*x])^p*(g*Sin[e + f*x])^p, Int[(a + b*Sin[e + f*x])^m*((
c + d*Sin[e + f*x])^n/(g*Sin[e + f*x])^p), x], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d
, 0] &&  !IntegerQ[p] &&  !(IntegerQ[m] && IntegerQ[n])

Rule 3060

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.
) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[-2*b*B*Cos[e + f*x]*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(2*n + 3)*Sqrt
[a + b*Sin[e + f*x]])), x] + Dist[(A*b*d*(2*n + 3) - B*(b*c - 2*a*d*(n + 1)))/(b*d*(2*n + 3)), Int[Sqrt[a + b*
Sin[e + f*x]]*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] &&
EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] &&  !LtQ[n, -1]

Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x))}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {a B \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)} \sqrt {\sec (c+d x)}}+\frac {1}{2} \left ((2 A+B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sqrt {a+a \cos (c+d x)}}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {a B \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)} \sqrt {\sec (c+d x)}}-\frac {\left ((2 A+B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{a}}} \, dx,x,-\frac {a \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d} \\ & = \frac {\sqrt {a} (2 A+B) \arcsin \left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}}{d}+\frac {a B \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)} \sqrt {\sec (c+d x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.05 \[ \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx=\frac {\sqrt {\cos (c+d x)} \sqrt {a (1+\cos (c+d x))} \sec \left (\frac {1}{2} (c+d x)\right ) \sqrt {\sec (c+d x)} \left (\sqrt {2} (2 A+B) \arcsin \left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right )+2 B \sqrt {\cos (c+d x)} \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d} \]

[In]

Integrate[Sqrt[a + a*Cos[c + d*x]]*(A + B*Cos[c + d*x])*Sqrt[Sec[c + d*x]],x]

[Out]

(Sqrt[Cos[c + d*x]]*Sqrt[a*(1 + Cos[c + d*x])]*Sec[(c + d*x)/2]*Sqrt[Sec[c + d*x]]*(Sqrt[2]*(2*A + B)*ArcSin[S
qrt[2]*Sin[(c + d*x)/2]] + 2*B*Sqrt[Cos[c + d*x]]*Sin[(c + d*x)/2]))/(2*d)

Maple [A] (verified)

Time = 22.68 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.50

method result size
default \(\frac {\left (B \sin \left (d x +c \right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}+2 A \arctan \left (\tan \left (d x +c \right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\right )+B \arctan \left (\tan \left (d x +c \right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\right )\right ) \left (\sqrt {\sec }\left (d x +c \right )\right ) \sqrt {a \left (1+\cos \left (d x +c \right )\right )}\, \cos \left (d x +c \right )}{d \left (1+\cos \left (d x +c \right )\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\) \(147\)
parts \(\frac {2 A \sqrt {a \left (1+\cos \left (d x +c \right )\right )}\, \arctan \left (\tan \left (d x +c \right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\right ) \left (\sqrt {\sec }\left (d x +c \right )\right ) \cos \left (d x +c \right )}{d \left (1+\cos \left (d x +c \right )\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}+\frac {B \left (\sin \left (d x +c \right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}+\arctan \left (\tan \left (d x +c \right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\right )\right ) \sqrt {a \left (1+\cos \left (d x +c \right )\right )}\, \left (\sqrt {\sec }\left (d x +c \right )\right ) \cos \left (d x +c \right )}{d \left (1+\cos \left (d x +c \right )\right ) \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\) \(204\)

[In]

int((A+B*cos(d*x+c))*(a+cos(d*x+c)*a)^(1/2)*sec(d*x+c)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/d*(B*sin(d*x+c)*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)+2*A*arctan(tan(d*x+c)*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2))+B
*arctan(tan(d*x+c)*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)))*sec(d*x+c)^(1/2)*(a*(1+cos(d*x+c)))^(1/2)*cos(d*x+c)/(1
+cos(d*x+c))/(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.99 \[ \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx=\frac {\sqrt {a \cos \left (d x + c\right ) + a} B \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - {\left ({\left (2 \, A + B\right )} \cos \left (d x + c\right ) + 2 \, A + B\right )} \sqrt {a} \arctan \left (\frac {\sqrt {a \cos \left (d x + c\right ) + a} \sqrt {\cos \left (d x + c\right )}}{\sqrt {a} \sin \left (d x + c\right )}\right )}{d \cos \left (d x + c\right ) + d} \]

[In]

integrate((A+B*cos(d*x+c))*(a+a*cos(d*x+c))^(1/2)*sec(d*x+c)^(1/2),x, algorithm="fricas")

[Out]

(sqrt(a*cos(d*x + c) + a)*B*sqrt(cos(d*x + c))*sin(d*x + c) - ((2*A + B)*cos(d*x + c) + 2*A + B)*sqrt(a)*arcta
n(sqrt(a*cos(d*x + c) + a)*sqrt(cos(d*x + c))/(sqrt(a)*sin(d*x + c))))/(d*cos(d*x + c) + d)

Sympy [F]

\[ \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx=\int \sqrt {a \left (\cos {\left (c + d x \right )} + 1\right )} \left (A + B \cos {\left (c + d x \right )}\right ) \sqrt {\sec {\left (c + d x \right )}}\, dx \]

[In]

integrate((A+B*cos(d*x+c))*(a+a*cos(d*x+c))**(1/2)*sec(d*x+c)**(1/2),x)

[Out]

Integral(sqrt(a*(cos(c + d*x) + 1))*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 939 vs. \(2 (84) = 168\).

Time = 0.48 (sec) , antiderivative size = 939, normalized size of antiderivative = 9.58 \[ \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx=\text {Too large to display} \]

[In]

integrate((A+B*cos(d*x+c))*(a+a*cos(d*x+c))^(1/2)*sec(d*x+c)^(1/2),x, algorithm="maxima")

[Out]

1/4*(4*A*sqrt(a)*arctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sin(1/2*arct
an2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + sin(d*x + c), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(
2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + cos(d*x + c)) + (2*(cos(2*d
*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*(cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x
+ 2*c) + 1))*sin(d*x + c) - (cos(d*x + c) - 1)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))*sqrt(
a) + sqrt(a)*(arctan2(-(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*(cos(1/2*arcta
n2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))*sin(d*x + c) - cos(d*x + c)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(
2*d*x + 2*c) + 1))), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*(cos(d*x + c)*co
s(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + sin(d*x + c)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*
d*x + 2*c) + 1))) + 1) - arctan2(-(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*(co
s(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))*sin(d*x + c) - cos(d*x + c)*sin(1/2*arctan2(sin(2*d*x +
 2*c), cos(2*d*x + 2*c) + 1))), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*(cos(
d*x + c)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + sin(d*x + c)*sin(1/2*arctan2(sin(2*d*x + 2
*c), cos(2*d*x + 2*c) + 1))) - 1) - arctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)
^(1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*
cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 1) + arctan2((cos(2*d*x
 + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2
*c) + 1)), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x
+ 2*c), cos(2*d*x + 2*c) + 1)) - 1)))*B)/d

Giac [F(-1)]

Timed out. \[ \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx=\text {Timed out} \]

[In]

integrate((A+B*cos(d*x+c))*(a+a*cos(d*x+c))^(1/2)*sec(d*x+c)^(1/2),x, algorithm="giac")

[Out]

Timed out

Mupad [F(-1)]

Timed out. \[ \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sqrt {\sec (c+d x)} \, dx=\int \left (A+B\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {1}{\cos \left (c+d\,x\right )}}\,\sqrt {a+a\,\cos \left (c+d\,x\right )} \,d x \]

[In]

int((A + B*cos(c + d*x))*(1/cos(c + d*x))^(1/2)*(a + a*cos(c + d*x))^(1/2),x)

[Out]

int((A + B*cos(c + d*x))*(1/cos(c + d*x))^(1/2)*(a + a*cos(c + d*x))^(1/2), x)